<template>
    <router-view />
</template>

<script lang="ts" setup>
import { useUserInfo } from "./store/user";
import { useStore } from "./store/index";
import { getAddress } from "./api/index";

const store = useUserInfo();
const $store = useStore();

//初始化
// getAddress().then((res: any) => {
//     let { result } = res;
//     $store.getAddrLength(result.length);
// });
// const init = () => {
// };

// init();

if (localStorage.getItem("auto_token")) {
    store.getToken(localStorage.getItem("auto_token"));
}

if (localStorage.getItem("user_info")) {
    // console.log(localStorage.getItem("user_info"));
    let data = JSON.parse(localStorage.getItem("user_info"));
    store.getInfo(data);
}

if (localStorage.getItem("user_look")) {
    // console.log(localStorage.getItem("user_info"));
    let data = JSON.parse(localStorage.getItem("user_look"));
    store.getUserLook(data);
}
</script>

<style lang="scss">
@import url(./static/style/reset.css);
</style>
